import json
import unittest
from pickle import FALSE

import requests
import config
from api.goproxy import GoProxy
from lib.writexhxtoken import WriteXhxToken


class PerformanceGrade(unittest.TestCase):
    def setUp(self):
        self.session = requests.session()

    def tearDown(self):
        self.session.close()

    def test01_goproxy(self):
        params= {"service_name":"classprod.PerformancePkQueryFacade.listPerformanceGrade","param":{}}
        # cookie = config.TOKEN_RESULT[0].get("xhx_token")
        WriteXhxToken().update_token_in_json()
        cookie = config.load_config().get("xhx_token")
        respone = GoProxy().goProxy(self.session,params,cookie)
        print(config.prints(respone))
        respone_json = respone.json()
        print(f'响应结果：{json.dumps(respone_json,indent=2,ensure_ascii=False)}')
        self.assertEqual(respone.json().get("msg"),"ok")